home *** CD-ROM | disk | FTP | other *** search
- VERSION 5.00
- Object = "{EAB22AC0-30C1-11CF-A7EB-0000C05BAE0B}#1.1#0"; "SHDOCVW.DLL"
- Begin VB.Form Form1
- Caption = "Command State Change Demo"
- ClientHeight = 6795
- ClientLeft = 60
- ClientTop = 345
- ClientWidth = 8100
- LinkTopic = "Form1"
- ScaleHeight = 6795
- ScaleWidth = 8100
- StartUpPosition = 2 'CenterScreen
- Begin SHDocVwCtl.WebBrowser webBrowser
- Height = 4935
- Left = 120
- TabIndex = 2
- Top = 1800
- Width = 7935
- ExtentX = 13996
- ExtentY = 8705
- ViewMode = 0
- Offline = 0
- Silent = 0
- RegisterAsBrowser= 0
- RegisterAsDropTarget= 1
- AutoArrange = 0 'False
- NoClientEdge = 0 'False
- AlignLeft = 0 'False
- ViewID = "{0057D0E0-3573-11CF-AE69-08002B2E1262}"
- Location = ""
- End
- Begin VB.TextBox txtURL
- Height = 405
- Left = 840
- TabIndex = 0
- Top = 1080
- Width = 6255
- End
- Begin VB.Image imgGo
- Height = 420
- Left = 7200
- Picture = "Form1.frx":0000
- Top = 1080
- Width = 720
- End
- Begin VB.Label Label1
- Alignment = 2 'Center
- Caption = "URL:"
- BeginProperty Font
- Name = "MS Sans Serif"
- Size = 8.25
- Charset = 0
- Weight = 700
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- Height = 255
- Left = 240
- TabIndex = 1
- Top = 1200
- Width = 495
- End
- Begin VB.Image imgForwardDis
- Height = 750
- Left = 960
- Picture = "Form1.frx":02D2
- ToolTipText = "Forward - Disabled"
- Top = 120
- Width = 750
- End
- Begin VB.Image imgForward
- Height = 750
- Left = 960
- Picture = "Form1.frx":066A
- ToolTipText = "Forward"
- Top = 120
- Width = 750
- End
- Begin VB.Image imgBackDis
- Height = 750
- Left = 120
- Picture = "Form1.frx":0B0D
- ToolTipText = "Back - Disabled"
- Top = 120
- Width = 750
- End
- Begin VB.Image imgBack
- Height = 750
- Left = 120
- Picture = "Form1.frx":0EA5
- ToolTipText = "Back"
- Top = 120
- Width = 750
- End
- Attribute VB_Name = "Form1"
- Attribute VB_GlobalNameSpace = False
- Attribute VB_Creatable = False
- Attribute VB_PredeclaredId = True
- Attribute VB_Exposed = False
- Option Explicit
- Private Sub imgBack_Click()
- webBrowser.GoBack
- End Sub
- Private Sub imgForward_Click()
- webBrowser.GoForward
- End Sub
- Private Sub imgGo_Click()
- webBrowser.Navigate txtURL.Text
- End Sub
- Private Sub txtURL_KeyPress(KeyAscii As Integer)
- If KeyAscii = 13 Then
- webBrowser.Navigate txtURL.Text
- End If
- End Sub
- Private Sub webBrowser_CommandStateChange(ByVal Command As Long, ByVal Enable As Boolean)
- If Command = 1 Then 'For the forward button
- If Enable = True Then
- imgForward.Visible = True
- imgForwardDis.Visible = False
- Else
- imgForward.Visible = False
- imgForwardDis.Visible = True
- End If
- End If
- If Command = 2 Then 'For the back button
- If Enable = True Then
- imgBack.Visible = True
- imgBackDis.Visible = False
- Else
- imgBack.Visible = False
- imgBackDis.Visible = True
- End If
- End If
- End Sub
-